load("@io_bazel_rules_go//go:def.bzl", "go_library")
load("//def:ts.bzl", "rollup_bundle", "ts_library")

go_library(
    name = "go_default_library",
    srcs = ["podinfo.go"],
    importpath = "k8s.io/test-infra/prow/spyglass/lenses/podinfo",
    visibility = ["//visibility:public"],
    deps = [
        "//prow/crier/reporters/gcs/kubernetes:go_default_library",
        "//prow/entrypoint:go_default_library",
        "//prow/spyglass/api:go_default_library",
        "//prow/spyglass/lenses:go_default_library",
        "@com_github_sirupsen_logrus//:go_default_library",
        "@io_k8s_api//core/v1:go_default_library",
        "@io_k8s_sigs_yaml//:go_default_library",
    ],
)

ts_library(
    name = "script",
    srcs = ["podinfo.ts"],
    deps = [
        "//prow/spyglass/lenses:lens_api",
    ],
)

rollup_bundle(
    name = "script_bundle",
    entry_point = ":podinfo.ts",
    deps = [
        ":script",
    ],
)

filegroup(
    name = "template",
    srcs = ["template.html"],
    visibility = ["//visibility:public"],
)

filegroup(
    name = "resources",
    srcs = [
        "style.css",
        ":script_bundle.min",
    ],
    visibility = ["//visibility:public"],
)

filegroup(
    name = "package-srcs",
    srcs = glob(["**"]),
    tags = ["automanaged"],
    visibility = ["//visibility:private"],
)

filegroup(
    name = "all-srcs",
    srcs = [":package-srcs"],
    tags = ["automanaged"],
    visibility = ["//visibility:public"],
)
